//定义
var loginManager1 = {};
loginManager1.login = function () {
    $.ajax({
        url: "/LoginServlet",
        type: "post",
        data: {
            "loginName": $("#loginName").val(),
            "loginPwd": $("#loginPwd").val()
        },
        dataType: "json",
        success: function (result) {
            if (result.status != 0) {
                alert("登录成功");
                window.location.href = "/index/views/main.html";
                window.localStorage.setItem("loginName",result.staffName);
                window.localStorage.setItem("staffId",result.staffId);
                window.localStorage.setItem("id",result.roleId);
                window.localStorage.setItem("phone",result.phone);
                window.localStorage.setItem("idCard",result.idCard);
                window.localStorage.setItem("address",result.address);
                window.localStorage.setItem("createdTime",result.createdTime);
                window.localStorage.setItem("password",result.password);
            }else{
                alert(result.message);
            }
        }
    });
}